#ifndef HardwareResourceManager_h__
#define HardwareResourceManager_h__

#include "Common/CommonTypes.h"
#include "HardwareResource.h"

class CHardwareResource;
class CVertexBuffer;
class CIndexBuffer;
class CD3DEffect;
class CD3D10RenderDevice;

class CHardwareResourceManager
{
public:
	CHardwareResourceManager(CD3D10RenderDevice* pDevice);
	~CHardwareResourceManager();

	CVertexBuffer* CreateVertexBuffer(EHardwareBufferUsage eUsage, UINT32 dwVertexSize, UINT32 dwVertexCount);
	CIndexBuffer*  CreateIndexBuffer(EHardwareBufferUsage eUsage, UINT32 dwIndexNum);
	CD3DEffect*    CreateEffect(const std::wstring& strEffectFile);
	void           ReleaseResource(CHardwareResource* pHardwareResource);

	
private:
	CD3D10RenderDevice*       m_pDevice;

	std::set<CVertexBuffer*>  m_VertexBuffers;
	std::set<CIndexBuffer*>   m_IndexBuffers;
	std::set<CD3DEffect*>    m_EffectTechs;

	UINT32 m_dwVertexBuffer_IDGen;
	UINT32 m_dwIndexBuffer_IDGen;
	UINT32 m_dwEffectTech_IDGen;
};
#endif // HardwareResourceManager_h__
